#include "GearToothPID.h"

/* 
 * Counter must be started or it will return 'Inf'
 */

GearToothPID::GearToothPID(UINT32 channel, bool directionSensitive = false) : GearTooth(channel, directionSensitive)
{
	Start();
}

GearToothPID::GearToothPID(UINT8 moduleNumber, UINT32 channel, bool directionSensitive = false) : GearTooth(moduleNumber, channel, directionSensitive)
{
	Start();
}

GearToothPID::GearToothPID(DigitalSource *source, bool directionSensitive = false) : GearTooth(source, directionSensitive)
{
	Start();
}

GearToothPID::GearToothPID(DigitalSource &source, bool directionSensitive = false) : GearTooth(source, directionSensitive)
{
	Start();
}

GearToothPID::~GearToothPID()
{
	Stop();
}

double GearToothPID::PIDGet()
{
	//return in RPM, instead of decimal seconds
	return (1/GetPeriod()) * 60;
}
